/**
 * @param {number[]} arr
 * @return {boolean}
*/
var uniqueOccurrences = function(arr) {
  let map = new Map();
  for(let i = 0; i < arr.length; i++) {
    if(map.has(arr[i])) {
      map.set(arr[i], map.get(arr[i]) + 1);
    } else {
      map.set(arr[i], 1);
    }
  }
  let result = [...map].sort((a, b) => a[1] - b[1]);
  for(let i = 0; i < result.length - 1; i++) {
    if(result[i][1] == result[i + 1][1]) return false;
  }
  return true;
};
let arr = [1,2,2,1,1,3];
console.log(uniqueOccurrences(arr));
arr = [1,2];
console.log(uniqueOccurrences(arr));
arr = [-3,0,1,-3,1,1,1,-3,10,0];
console.log(uniqueOccurrences(arr));
